
package xyz.zq.cloud.bs.api.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import xyz.zq.cloud.bs.api.entity.Log;
import xyz.zq.cloud.bs.api.feign.factory.RemoteLogServiceFallbackFactory;
import xyz.zq.cloud.common.core.constant.SecurityConstants;
import xyz.zq.cloud.common.core.constant.ServiceNameConstants;
import xyz.zq.cloud.common.core.util.R;

/**
 * feign 调用日志
 */
@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.CBS_SERVICE, fallbackFactory = RemoteLogServiceFallbackFactory.class)
public interface RemoteLogService {
    /**
     * 保存日志
     *
     * @param sysLog 日志实体
     * @param from   内部调用标志
     * @return success、false
     */
    @PostMapping("/log")
    R<Boolean> saveLog(@RequestBody Log sysLog, @RequestHeader(SecurityConstants.FROM) String from);
}
